﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LL.Business;
using LL.Common;

namespace LL.Business
{
    public class DataListService : ServiceBase
    {
        public LoadDataResponse GetDataList<T>(LoadDataRequest request)
        {
            //过滤已删除的数据（这个应该要放到BasePage里面？）
            if (typeof(T).Is<ILogicalDelete>())
                request.QueryCondition.And("IsDeleted", Comparison.Equal, false);
            return DbSession.Query<T>(request);
        }

        public IList<T> GetDataList<T>(string where, params object[] parameters)
        {
            //过滤已删除的数据（这个应该要放到BasePage里面？）
            //if (typeof(T).Is<ILogicalDelete>())
            //    request.QueryCondition.And("IsDeleted", CompareOperator.Equal, false);
            return DbSession.Query<T>(where, null, parameters);
        }
    }
}
